package auto.common.core;
import auto.common.service.ParameterAssemblyService;
import auto.common.service.impl.ParameterAssemblyServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.net.URL;
import java.util.HashMap;

/**
 * 核心执行方法
 *
 * @author yangsen
 * @date 2025-10-26
 */
public class CoreExecution {

    // 获取当前类的日志对象（推荐使用类名作为日志名）
    private static final Logger logger = LoggerFactory.getLogger(CoreExecution.class);


    /**
     * 执行测试用例,且校验模板
     * @param vars 自定义变量
     */
    public void sendAllReuests(HashMap<String,Object> vars){
        Class<? extends CoreExecution> aClass = this.getClass();
        String className = aClass.getSimpleName() + ".class";
        URL classUrl = aClass.getResource(className);
        ParameterAssemblyService parameterAssemblyService=new ParameterAssemblyServiceImpl();
        String fliePath = parameterAssemblyService.getExcelPathFromClassPath(classUrl.toString(), className);
        logger.info("读取到testCase用例层EXCEL路径为: " + fliePath);
        parameterAssemblyService.ReadTemplateExcel(fliePath);

    }


}
